import React from "react";
import "@styles/components/Dialog.scss";
type IProps = {
  visible: Boolean;
  onCancel: () => void;
  onConfirm: () => void;
};
class Dialog extends React.Component<IProps> {
  constructor(props: any) {
    super(props);
  }
  render() {
    return this.props.visible ? (
      <div className="modal-mask">
        <div className="modal-wrap">
          <div className="header">
            <div className="title">再次确认</div>
          </div>
          <div className="body">{this.props.children}</div>
          <div className="footer">
            <div className="cancel" onClick={this.props.onCancel.bind(this)}>
              取消
            </div>
            <div className="confirm" onClick={this.props.onConfirm.bind(this)}>
              确定
            </div>
          </div>
        </div>
      </div>
    ) : (
      <span></span>
    );
  }
}

export default Dialog;
